An entity may use a software application, such as a web service, to automate various processes and to interact with other entities in a distributed environment, such as the Internet or World Wide Web, or a corporate intranet or wide area or local area network. To ensure that such interactions are accomplished successfully, one or more protocols should be in place for carrying messages to and from participants, and specific applications should also be in place at each participant's end. Such interactions are message-driven. For example, a buyer sends a purchase order to a seller. The seller then checks its inventory to determine if it can provide the ordered items. If so, the seller sends an acknowledgement back to the buyer with a price. Finally, the buyer accepts or rejects the seller's offer (and/or possibly places another order). As evident in this example, each participant's application reacts to the receipt of messages.
Many such interactions and processes may take place at a given time. In addition, the same interaction may be carried out at the same time between different parties. For example, the buyer may send several purchase orders to different sellers. Thus, at any given time multiple instances of each interaction and/or an instance of many different processes may need to be processed. A conventional system for processing such messages may become overburdened when messages arrive too quickly for the system to handle, or when too many interactions or other processes are occupying resources without making progress toward completion.
An example of a situation where a message processing system may become overburdened is when the arrival rate of messages becomes too great. In such a situation, the system expends a large percentage of available resources on servicing the arrival of the messages—such as determining to which instance each message belongs, whether the message requires the creation of a new instance, and so forth—which leaves few resources available to actually process the messages. A system in such a state is said to be “thrashing.” In addition, a large amount of processing power is typically required to process a message, which complicates the issue of handling a large number of arriving messages. For example, when processing a message the system may need to update one or more database entries based on the message, transmit one or more messages, and so forth. Therefore, as the processing power required to process a message increases, the number of incoming messages required to overburden the message processing system decreases. When a system receives a greater number of messages than it can adequately process, the system can produce errors, loose data, or may simply become very slow and/or unresponsive. For example, in the above buyer/seller scenario, the transaction may be delayed, the messages with the buyer's and/or seller's instructions may be lost or corrupted, and/or the entire transaction aborted as a result of the system's inability to adequately process the messages.
A conventional message processing system that experiences such overburdening issues is also especially vulnerable to “denial of service” computer attacks. In such attacks, a hostile party transmits a very large number of messages to a particular message processing system. The system becomes overwhelmed when attempting to process the messages, and as a result the process(es) the system is supposed to be running are adversely affected or interrupted entirely.
Accordingly, and in light of the above shortcomings, what is needed is a system and method for throttling, or controlling the arrival rate of new messages, and selectively moving work that is already being processed into secondary storage. More particularly, what is needed is an agent that retrieves a new message and directs such a message to its instance. Even more particularly, what is needed is a controller that uses feedback from the instance state to control instance swapping to optimize performance of the message processing system.